//
//  TAMTMeeage.m
//  TAMeetApp
//
//  Created by Admin on 2024/12/10.
//

#import "TAMTMeeage.h"

@implementation TAMTMeeage

- (instancetype)initWithType:(MessageType)messageType
                     content:(NSString *)content
                   timestamp:(NSDate *)timestamp
                    isSender:(BOOL)isSender
                        user:(TAMTUser *)user {
    self = [super init];
    if (self) {
        _messageType = messageType;
        _content = [content copy];
        _timestamp = timestamp;
        _isSender = isSender;
        _user = user;
    }
    return self;
}

+ (NSArray <TAMTMeeage *>*)defuatMessages {
    // 创建用户信息
    TAMTUser *user1 = [[TAMTUser alloc] initWithUserId:@"1001" nickname:@"小明" avatarURL:@"https://example.com/avatar1.jpg" gender:1];
    TAMTUser *user2 = [[TAMTUser alloc] initWithUserId:@"1002" nickname:@"小红" avatarURL:@"https://example.com/avatar2.jpg" gender:2];
            
    // 创建模拟的消息数组
    NSArray<TAMTMeeage *> *messages = @[
        [[TAMTMeeage alloc] initWithType:MessageTypeText content:@"你好！" timestamp:[NSDate date] isSender:YES user:user1],
        [[TAMTMeeage alloc] initWithType:MessageTypeText content:@"你好，小明！" timestamp:[NSDate date] isSender:NO user:user2],
        [[TAMTMeeage alloc] initWithType:MessageTypeImage content:@"https://example.com/image1.jpg" timestamp:[NSDate date] isSender:YES user:user1],
        [[TAMTMeeage alloc] initWithType:MessageTypeText content:@"这张照片真不错！" timestamp:[NSDate date] isSender:NO user:user2],
        [[TAMTMeeage alloc] initWithType:MessageTypeVideo content:@"https://example.com/video1.mp4" timestamp:[NSDate date] isSender:YES user:user1],
        [[TAMTMeeage alloc] initWithType:MessageTypeEmoji content:@"😄" timestamp:[NSDate date] isSender:NO user:user2],
        [[TAMTMeeage alloc] initWithType:MessageTypeText content:@"你最近怎么样？" timestamp:[NSDate date] isSender:YES user:user1],
        [[TAMTMeeage alloc] initWithType:MessageTypeText content:@"还不错，你呢？" timestamp:[NSDate date] isSender:NO user:user2],
        [[TAMTMeeage alloc] initWithType:MessageTypeImage content:@"https://example.com/image2.jpg" timestamp:[NSDate date] isSender:NO user:user2],
        [[TAMTMeeage alloc] initWithType:MessageTypeText content:@"看起来很好吃！" timestamp:[NSDate date] isSender:YES user:user1],
        [[TAMTMeeage alloc] initWithType:MessageTypeText content:@"下次一起去吃吧！" timestamp:[NSDate date] isSender:NO user:user2],
        [[TAMTMeeage alloc] initWithType:MessageTypeEmoji content:@"👍" timestamp:[NSDate date] isSender:YES user:user1]
    ];
    return messages;
}

@end
